Imports System.Net.NetworkInformation
Imports System.Management
Imports System.Net

Public Class PC

    'Public Shared Function ISOnLine() As Boolean
    '    Return True
    'End Function
    'Public Shared Function PCNombre() As String

    '    Dim strValue As String = ""

    '    strValue = My.Computer.Name

    '    Return strValue
    'End Function
    'Public Shared Function GetMAC() As String

    '    Dim strValue As String = ""
    '    Try
    '        For Each nic As System.Net.NetworkInformation.NetworkInterface In System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces
    '            strValue = nic.GetPhysicalAddress.ToString
    '            If strValue.Trim <> "" And strValue <> "000000000000" Then
    '                Exit For
    '            End If
    '        Next
    '    Catch ex As Exception
    '        MsgBox(ex.Message)
    '    End Try


    '    Return strValue.ToUpper

    'End Function
    'Public Shared Function GetIP() As String

    '    Dim strValue As String = ""

    '    Dim obj As New IPHostEntry
    '    obj = Dns.GetHostEntry(My.Computer.Name)
    '    strValue = obj.AddressList(0).ToString

    '    Return strValue

    'End Function
    'Public Shared Function GetSerialHardDisk() As String

    '    Dim strValue As String = ""
    '    Dim strDiscoC As String = "C:"

    '    Dim disk As ManagementObject = New ManagementObject("win32_logicaldisk.deviceid=""" & strDiscoC & """")

    '    Try
    '        disk.Get()
    '        If Not disk("VolumeSerialNumber") Is Nothing Then
    '            strValue = disk("VolumeSerialNumber").ToString
    '        Else
    '            strValue = ""
    '        End If

    '    Catch ex As System.Management.ManagementException
    '        MsgBox(ex.Message)
    '    End Try

    '    Return strValue.ToUpper

    'End Function
    'Public Shared Function ConectadoInternet(ByVal _host As String, ByVal time As Integer) As Boolean

    '    Dim blnValue As Boolean = False

    '    If My.Computer.Network.IsAvailable Then

    '        Dim p As Ping = New Ping

    '        Try
    '            Dim reply As PingReply = p.Send(_host, time)

    '            If reply.Status = IPStatus.Success Then
    '                blnValue = True
    '            End If
    '        Catch ex As Exception
    '            blnValue = False
    '        End Try

    '    End If

    '    Return blnValue


    'End Function
    ' ''' <summary>
    ' ''' Ejecuta comandos DOS
    ' ''' </summary>
    ' ''' <param name="vEjecutable">direccion fisica del exe</param>
    ' ''' <param name="vParametro">parametros</param>
    ' ''' <returns>mensaje del cmd</returns>
    ' ''' <remarks></remarks>
    'Public Shared Function EjecutarCmd(ByVal vEjecutable As String, ByVal vParametro As String) As String
    '    Dim _str As String


    '    'Armar el proceso a ejecutar
    '    Dim startInfo As System.Diagnostics.ProcessStartInfo = New System.Diagnostics.ProcessStartInfo(vEjecutable, vParametro)

    '    'Para poder manupular la salida indicamos que no se ejecute el shell
    '    startInfo.UseShellExecute = False

    '    'Por definicion (o mejor dicho codificacion) debemos ajustarnos a los que nos dice "San MSDN" 
    '    '(...)UseShellExecute debe ser true si se desea establecer ErrorDialog en true(...)
    '    startInfo.ErrorDialog = False

    '    'Sin ventana...
    '    startInfo.CreateNoWindow = True

    '    'Deseamos manipular la salida del proceso, para ello debemos establecer que se redirija la salida
    '    startInfo.RedirectStandardOutput = True

    '    Try
    '        Dim p As Diagnostics.Process = System.Diagnostics.Process.Start(startInfo)

    '        'Leemos la salida (objeto StreamReader)
    '        Dim sr As System.IO.StreamReader = p.StandardOutput
    '        Dim cadenaSalida As String = sr.ReadToEnd()
    '        sr.Close()

    '        'La visualizamos en el textbox. Un ejemplo basico ;)...
    '        _str = cadenaSalida
    '    Catch ex As Exception
    '        _str = (ex.Message)
    '    End Try




    '    Return _str
    'End Function


End Class
